﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
            {
                Path = "~/scripts/jquery-3.4.1.min.js",
                DebugPath = "~/scripts/jquery-3.4.1.js",
                CdnPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-3.4.1.min.js",
                CdnDebugPath =
     "http://ajax.microsoft.com/ajax/jQuery/jquery-3.4.1.js"
            });
            if (!IsPostBack)
            {
                TextBox1.Text = Request.QueryString["name"];
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text== (string)Session["name"] && TextBox2.Text== (string)Session["password"])
            {
                Label1.Text = "登录成功";
                Label2.Text = "<a href = \" WebForm3.aspx \">转跳至登录页面</a>";
            }
            else
            {
                Label1.Text = "账号或密码错误！";
            }
        }
    }
}